package com.qianxp.designparttern.singleton;

import java.util.concurrent.CountDownLatch;
/**
 *@author qianxp
 */
public class TestMain {
    public static void main(String[] args) {
        int c = 20000;
        CountDownLatch countDownLatch = new CountDownLatch(c);
        for (int i = 0; i < c; i++) {
           new Thread(() -> {
                try {
                    countDownLatch.await();
                    System.out.println(Lazy.getInstance());
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
              
          }).start();
          countDownLatch.countDown();
        }
        
  }
}